import { defHttp } from '../http'
import type { CommonAPI } from '../model/_utils'

// 获取dns服务器列表
export const dnsServerListApi: CommonAPI<'/v1/ns', 'get'> = params =>
  defHttp.get('/ns', { params })

// 新增dns服务器
export const postDnsServerApi: CommonAPI<'/v1/ns', 'post'> = data =>
  defHttp.post('/ns', { data })

// 删除dns服务器
export const deleteDnsServerApi: CommonAPI<'/v1/ns/{id}', 'delete'> = params =>
  defHttp.delete('/ns/' + params.id)

// 修改dns服务器
export const putDnsServerApi: CommonAPI<'/v1/ns/{id}', 'put'> = data =>
  defHttp.put('/ns/' + data.id, { data })
